<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">


        <a href="http://www.baidu.com"    data-index='100'>    绑定静态属性</a>
        <!-- v-bind 绑定动态属性   v-bind的简写 ： -->

        <a  v-bind:href="url"    data-index='100'>    绑定动态属性</a>
        <a  :href="url"    data-index='100'   @click.stop.prevent='change'  id='aa'>    绑定动态属性  方法切换</a>
     
    </div>
    <script src="./vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                url:'http://www.baidu.com' 
            },
            methods: {
                change() {
                    this.url='https://cn.vuejs.org/v2/api/#v-bind'

                    // 不推荐操作dom
                    // var  aDom=document.getElementById('aa')
                   
                    // aDom.href='https://cn.vuejs.org/v2/api/#v-bind'
                }


            }
        });
    </script>
</body>

</html>